
import time
import asyncio

async def send_email():
    await asyncio.sleep(5)  

async def send_msg():
    await asyncio.sleep(5)  


def run():
    tasks = []
    for i in range(100000):
        tasks.append(send_email())
        tasks.append(send_msg())
    loop.run_until_complete(asyncio.wait(tasks))

loop = asyncio.get_event_loop()
if __name__ == "__main__":
    start = time.time()
    run()
    print(time.time() - start)

